﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TeamCityMonitor.Models;
using TeamCitySharp.DomainEntities;

namespace TeamCityMonitor.Repository.Caches
{
    public class TeamCityStatisticsCacheObject
    {
        public TeamCityStatisticsCacheObject()
        {
            NoOfProjects = NoOfConfigurations = NoOfBuilds = NoOfBuildsSince = NoOfSuccessfullBuildsSince = NoOfFailingBuildsSince = NoOfErrorBuildsSince = NoOfUnknownBuildsSince = NoOfSuccessfullBuilds = NoOfFailingBuilds = NoOfErrorBuilds = NoOfUnknownBuilds = 0;
            NoOfBuildsByUser = new Dictionary<string, int>();
            NoOfSuccessfullBuildsByUser = new Dictionary<string, int>();
            NoOfFailingBuildsByUser = new Dictionary<string, int>();
            NoOfErrorBuildsByUser = new Dictionary<string, int>();
            NoOfBuildsByBuildConfig = new Dictionary<string, int>();
            NoOfSuccessfullBuildsByBuildConfig = new Dictionary<string, int>();
            NoOfFailingBuildsByBuildConfig = new Dictionary<string, int>();
            NoOfErrorBuildsByBuildConfig = new Dictionary<string, int>();
        }

        public int NoOfProjects;
        public int NoOfConfigurations;

        public int NoOfBuilds;
        public int NoOfSuccessfullBuilds;
        public int NoOfFailingBuilds;
        public int NoOfErrorBuilds;
        public int NoOfUnknownBuilds;

        public int NoOfBuildsSince;
        public int NoOfSuccessfullBuildsSince;
        public int NoOfFailingBuildsSince;
        public int NoOfErrorBuildsSince;
        public int NoOfUnknownBuildsSince;

        public Dictionary<string, int> NoOfBuildsByUser;
        public Dictionary<string, int> NoOfSuccessfullBuildsByUser;
        public Dictionary<string, int> NoOfFailingBuildsByUser;
        public Dictionary<string, int> NoOfErrorBuildsByUser;
        public Dictionary<string, int> NoOfBuildsByBuildConfig;
        public Dictionary<string, int> NoOfSuccessfullBuildsByBuildConfig;
        public Dictionary<string, int> NoOfFailingBuildsByBuildConfig;
        public Dictionary<string, int> NoOfErrorBuildsByBuildConfig;
    }
}